package com.plian.system.controller.sys.fun;

import com.plian.Tools.base.BaseController;
import com.plian.Tools.pagedata.PageData;
import com.plian.system.model.ListResult;
import com.plian.system.model.ObjResult;
import com.plian.system.service.sys.fun.FunService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 账号-单位权限
 */
@RestController
@RequestMapping(value = "api/fun")
@Deprecated
public class FunController extends BaseController {
    @Autowired
    FunService funService;
    @PostMapping(value = "/list")
    public ListResult<PageData> list(@RequestBody PageData pd){
        return funService.funZtree(pd);
    }
    @PostMapping(value = "/save")
    public ObjResult save(@RequestBody PageData pd){
        return funService.save(pd);
    }
    @PostMapping(value = "/edit")
    public ObjResult edit(@RequestBody PageData pd){
        return funService.edit(pd);
    }
    @PostMapping(value = "/del_ids")
    public ObjResult del_ids(@RequestBody PageData pd){
        return funService.del_ids((List<String>) pd.get("ids"));
    }
    @PostMapping(value = "/findid")
    public ObjResult findid(@RequestBody PageData pd){
        return funService.findbyid(pd);
    }
    @PostMapping(value = "/adjustment")
    public ObjResult adjustment(@RequestBody PageData pd){
        return funService.adjustment(pd);
    }
//    @PostMapping(value="/allModules")
//    public ListResult<PageData>  allModules(@RequestBody PageData pd){
//        return funService.getFormType();
//    };
}
